package org.lilred.nzbberry.queue;


public class NZBObject {
	private String _status;
	private int _index;
	private String _eta;
	private String _timeleft;
	private String _avg_age;
	private String _script;
	private int _msgid;
	private String _verbosity;
	private double _mb;
	private double _mbleft;
	private String _filename;
	private Priority _priority;
	private String _category;
	private int _percentage;
	private String _nzo_id;
	private int _unpackopts;
	private String _size;

	/**
	 * @return the average age of the NZB
	 */
	public String getAvgAge() {
		return _avg_age;
	}

	/**
	 * @return the category of the NZB
	 */
	public String getCategory() {
		return _category;
	}

	/**
	 * @return the estimated date & time that the download will complete
	 */
	public String getEta() {
		return _eta;
	}

	/**
	 * @return the filename of the NZB
	 */
	public String getFilename() {
		return _filename;
	}

	/**
	 * @return the index
	 */
	public int getIndex() {
		return _index;
	}

	/**
	 * @return the size of the file
	 */
	public double getMb() {
		return _mb;
	}

	/**
	 * @return the number of mb remaining
	 */
	public double getMbLeft() {
		return _mbleft;
	}

	/**
	 * @return the message id of the NZB
	 */
	public int getMsgId() {
		return _msgid;
	}

	/**
	 * @return the nzoId of the NZB
	 */
	public String getNzoId() {
		return _nzo_id;
	}

	/**
	 * @return the last reported percentage of completion
	 */
	public int getPercentage() {
		return _percentage;
	}

	/**
	 * @return the priority NZB
	 * @see Priority
	 */
	public Priority getPriority() {
		return _priority;
	}
	
	/**
	 * @return the script to be executed when the NZB completes
	 */
	public String getScript() {
		return _script;
	}

	/**
	 * @return the size of the NZB as a formatted string
	 */
	public String getSize() {
		return _size;
	}

	/**
	 * @return the status of the NZB
	 * @see SlotStatus
	 */
	public String getStatus() {
		return _status;
	}

	/**
	 * @return the estimated amount of time until the download completes
	 */
	public String getTimeLeft() {
		return _timeleft;
	}

	/**
	 * @return the unpack options of the NZB
	 */
	public int getUnpackOpts() {
		return _unpackopts;
	}

	/**
	 * @return the verbosity of the NZB
	 */
	public String getVerbosity() {
		return _verbosity;
	}

	/**
	 * Set the category of the NZB
	 * @param newCategory the new category of the NZB
	 */
	public void setCategory(String category) {
		_category = category;
		QueueProxy.getInstance().setCategory(_nzo_id, _category);
	}

	/**
	 * @param filename the new name of the NZB
	 */
	public void setFilename(String filename) {
		this._filename = filename;
		QueueProxy.getInstance().setName(_nzo_id, _filename);
	}

	/**
	 * Moves the NZB to a specific location in the queue
	 * @param the new index
	 */
	public void setIndex(int _index) {
		this._index = _index;
		QueueProxy.getInstance().moveToLocation(_nzo_id, _index);
	}

	/**
	 * Set the priority of the NZB
	 * @param priority the new priority of the NZB
	 * @see Priority
	 */
	public void setPriority(Priority priority) {
		this._priority = priority;
		QueueProxy.getInstance().setPriority(_nzo_id, _priority);
	}

	/**
	 * Sets the script to be executed after the NZB completes
	 * @param the new script of the NZB
	 */
	public void setScript(String script) {
		this._script = script;
		QueueProxy.getInstance().setScript(_nzo_id, _script);
	}
}
